/*
 *  Copyright (c) 2011 Leibniz Institute of Plant Genetics and Crop Plant Research (IPK), Gatersleben, Germany.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the GNU Lesser Public License v2.1
 *  which accompanies this distribution, and is available at
 *  http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 *  Contributors:
 *      Leibniz Institute of Plant Genetics and Crop Plant Research (IPK), Gatersleben, Germany - initial API and implementation
 */
package de.ipk_gatersleben.bit.bi.edal.primary_data.reference;

import de.ipk_gatersleben.bit.bi.edal.primary_data.DataManager;
import de.ipk_gatersleben.bit.bi.edal.primary_data.file.PrimaryDataEntityVersion;
import de.ipk_gatersleben.bit.bi.edal.primary_data.file.PublicReference;

public class URLReference implements EdalReferenceable {

	@Override
	public String acceptApprovalRequest(PublicReference publicReference)
			throws EdalApprovalException {

		String url = null;
		try {
			url = DataManager.getImplProv().getApprovalServiceProvider()
					.newInstance().getNewURL(publicReference);
		} catch (InstantiationException | IllegalAccessException e) {
			throw new EdalApprovalException(
					"unable to get a new URL for the PublicReference");
		}
		return url;
	}

	@Override
	public void rejectApprovalRequest(PublicReference publicReference)
			throws EdalApprovalException {
		// TODO Auto-generated method stub

	}

	@Override
	public void validateMetaData(PrimaryDataEntityVersion entityVersion)
			throws EdalPublicationMetaDataException {
		// TODO Auto-generated method stub

	}

	@Override
	public void validate(PrimaryDataEntityVersion entityVersion)
			throws EdalPublicationMetaDataException {
		// TODO Auto-generated method stub

	}

}
